Errores que puede dar la instalacion inicial para poder compilar programas con el KDE Framework
NOTA: Todos los errores que aparecen a continuacion son errores de cmake ya que no puede encontrar las librerias de las que depende el programa que vamos a compilar, no son errores del KDE Framework en si.
Para poder compilar con el KDE Framework necesitamos instalar estos paquetes:
# zypper in cmake make gcc-c++ extra-cmake-modules libQt5Core-devel libQt5Widgets-devel ki18n-devel kcoreaddons-devel kwidgetsaddons-devel kxmlgui-devel ktextwidgets-devel
La lista completa de la instalacion, con sus comandos y su salida esta en el archivo typescript
Para compilar un programa con el KDE Framework se sigue la siguiente ejecucion de comandos
El primer paso seria tener instalados cmake, make y compiladores de C/C++
Primero ejecutamos cmake ./ y vemos el siguiente error:
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_CXX_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
Este error se da porque no tenemos instalado el compilador de C++, lo instalamos:
# zypper in gcc-c++
volvemos a ejecutars cmake ./ y vemos el siguiente error:
CMake Error at CMakeLists.txt:8 (find_package):
Could not find a package configuration file provided by "ECM" (requested
version 1.0.0) with any of the following names:
ECMConfig.cmake
ecm-config.cmake
Add the installation prefix of "ECM" to CMAKE_PREFIX_PATH or set "ECM_DIR"
to a directory containing one of the above files. If "ECM" provides a
separate development package or SDK, be sure it has been installed.
Este error se produce porque falta el modulo ECM del cmake, lo podemos instalar con el siguiente comando:
# zypper in extra-cmake-modules
volvemos a ejecutars cmake ./ y vemos el siguiente error:
CMake Error at CMakeLists.txt:17 (find_package):
Could not find a package configuration file provided by "Qt5" (requested
version 5.3.0) with any of the following names:
Qt5Config.cmake
qt5-config.cmake
Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
to a directory containing one of the above files. If "Qt5" provides a
separate development package or SDK, be sure it has been installed.
Este error se produce porque faltan algunas librerias de desarrollo de Qt5 las instalamos con el siguiente comando:
zypper in libQt5Core-devel
volvemos a ejecutars cmake ./ y vemos el siguiente error:
CMake Error at /usr/lib64/cmake/Qt5/Qt5Config.cmake:28 (find_package):
Could not find a package configuration file provided by "Qt5Widgets" with
any of the following names:
Qt5WidgetsConfig.cmake
qt5widgets-config.cmake
Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set
"Qt5Widgets_DIR" to a directory containing one of the above files. If
"Qt5Widgets" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
CMakeLists.txt:17 (find_package)
Ahora nos faltan librerias de desarrollo de Qt5Widgets las instalamos con el siguiente comando:
# zypper in libQt5Widgets-devel
volvemos a ejecutars cmake ./ y vemos el siguiente error:
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find KF5 (missing: CoreAddons I18n WidgetsAddons) (Required is at
least version "5.2.0")
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/usr/share/ECM/find-modules/FindKF5.cmake:93 (find_package_handle_standard_args)
CMakeLists.txt:23 (find_package)
Nos faltan mas librerias de desarrollo, concretamente de I18n, CoreAddons y WidgetsAddons, las instalamos con el siguiente comando:
# zypper in ki18n-devel kcoreaddons-devel kwidgetsaddons-devel
Despues de tantos errores, ejecutamos nuevamente cmake ./ y esta vez por fin se ejecuta sin fallos:
Ahora ejecutamos make para compilar el programa
:
Y tambien se compila sin ningun tipo de error, nuestro programa ya esta compilado y listo para ser ejecutado
La lista completa de los nuevos comandos y su salida esta en el archivo typescript2
Al crear aplicaciones con unos widgets distintos al anterior programa obtengo nuevos errores:
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find KF5 (missing: XmlGui TextWidgets) (found suitable version
"5.84.0", minimum required is "5.68.0")
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/usr/share/ECM/find-modules/FindKF5.cmake:93 (find_package_handle_standard_args)
CMakeLists.txt:21 (find_package)
Para solucionar este error instalamos las siguientes librerias:
# zypper in kxmlgui-devel ktextwidgets-devel
KDE Framework | Instalacion | Manual